import * as obj from '@/api/table'

const usertable = {
  actions: {
    querySubAccount({ commit, state }, params) { //子账号管理-分页查询子账户
      return new Promise((resolve, reject) => {
        obj.querySubAccount(params).then(res => {
          resolve(res)
        }).catch(error => {
          reject(error)
        })
      })
    },
    createAccount({ commit, state }, params) { //创建模板
      return new Promise((resolve, reject) => {
        obj.createAccount(params).then(res => {
          resolve(res)
        }).catch(error => {
          reject(error)
        })
      })
    },
    updateAccount({ commit, state }, params) { //创建模板
      return new Promise((resolve, reject) => {
        obj.updateAccount(params).then(res => {
          resolve(res)
        }).catch(error => {
          reject(error)
        })
      })
    },
    getAccount({ commit, state }, params) { //子账号管理-查看子账号
      return new Promise((resolve, reject) => {
        obj.getAccount(params).then(res => {
          resolve(res)
        }).catch(error => {
          reject(error)
        })
      })
    },
  }
}

export default usertable
